package com.cd.sendRequest.jpa.repo;

import com.cd.sendRequest.jpa.domain.DYResult;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DYResultRepo  extends JpaRepository<DYResult, Long> {

    //查询当月的粉丝数据
    @Query("SELECT d FROM DYResult d WHERE d.recordTime LIKE CONCAT(:date,'%')")
    List<DYResult> findAllByMonth(String date);

    List<DYResult> findByUserId(String userId);

    @Query("SELECT d FROM DYResult d WHERE d.recordTime LIKE CONCAT(:date,'%') and d.userId=:userId")
    List<DYResult> findAllByDateAndUserId(String date,String userId);
}
